import Router from 'koa-router'
import axios from '../tools/axios.js'

let router = new Router({prefix: '/scenes'})

router.get('/quality' , async(ctx) => {
    let {theme , tab , limit , ci} = ctx.query;
    let {status , data} = await axios.get('https://nn.meituan.com/ptapi/getScenesList' , {
        params:{
            theme,
            tab,
            limit,
            ci
        }    
    });
    ctx.body = {
        code: 0,
        store: data
    }
})

router.get('/maoyan' , async(ctx) => {
    let {limit , ci} = ctx.query;
    let maoyan = {};
    let {status , data:{data:{hot}}} = await axios.get('https://nn.meituan.com/ptapi/getHotFilms' , {
        params:{
            limit,
            ci
        }
    })
    let {status2 , data:{data:{coming}}} = await axios.get('https://nn.meituan.com/ptapi/getComingFilms' , {
        params:{
            limit,
            ci
        }
    })
    maoyan = {
        hot,
        coming
    }
    ctx.body = {
        code: 0,
        movie: maoyan
    }
})

router.get('/recommond' , async(ctx) => {
    let {status , data} = await axios.get('https://nn.meituan.com/ptapi/recommends')
    ctx.body = {
        code: 0,
        like: data
    }
})

export default router
















